package com.ymatou.authapp.service;
import org.json.JSONException;
import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*用户在指定时间内登陆失败的次数接口Bean
*FreeMaker Template自动生成代码
*/
public class BillsLoginIdModifyEventRequestDtoCall extends YmatouBaseCall{
	private static String opurl ="json/reply/BillsLoginIdModifyEventRequestDto";
	
	public BillsLoginIdModifyEventRequestDtoCall() {
		super(EnvSetup.getSystemUrl("api_authapp"), opurl,"GET","PARAM");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}

	public String getMsg(){
		String msg=null;	
		try {
			msg=new JSONObject(getReturnData()).getString("LastErrorMessage");
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return msg;
	}
	
	/**
	 * 获取用户更改用户信息的次数
	 * @return
	 */
	public int getModifyLoginIdCount(){
		Integer count = 0;
		try {
			count=new JSONObject(getReturnData()).getInt("Result");
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return count;
	}
	
	/**
	 * 获取是否成功
	 * 
	 * @return Boolean
	 */
	public Boolean getSuccess() {
		Boolean Success = null;
		try {
			JSONObject jo = new JSONObject(getReturnData());
			Success = jo.getBoolean("Success");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Success;
	}
}
